/*
 * FileName: classTplSpecialization.cc
 * Author: 李波(Edwin Lee)
 * Date: 2024-07-14 09:27:16
 * Version: 1.0
 * Description: 类模板的特例化
 */
#include <iostream>
#include <cstring>
using namespace std;

//lei 模板
template<typename T>
class Vector 
{
public:
	Vector(){cout << "call Vector template init" << endl;}
};

//对char*类型提供的完全特例化
template<>
class Vector<char*>
{
public:
	Vector(){cout << "call Vector<char*>" <<endl;}
};

//下面这个是对指针类型提供的部分特例化版本
template<typename Ty>
class Vector<Ty*>
{
public:
	Vector(){cout << "call Vector<Ty*> init" << endl;}
};

//给函数指针类型提供一个部分特例化版本
template<typename R, typename A,typename B>
class Vector<R(*)(A,B)>
{
public:
	Vector(){cout << "call Vector<R(*)(A,B)>"<<endl;}
};


int main()
{
	Vector<int> vec1;
	Vector<char*> vec2;
	Vector<int*> vec3; 							//指针
	Vector<int(*)(int,int)> vec4; 	//函数指针
	return 0;
}
